<template>
  <div id="nav">
    <router-link to="/">根据 tsx 实现</router-link>
    &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
    <router-link to="/ByTemplate">根据 template 实现</router-link>
    &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
    <router-link to="/BySetup">setup、vuex</router-link>
    &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
    <router-link to="/ByScriptSetup">script setup、vuex</router-link>
    &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
    <router-link to="/ByPinia">pinia</router-link>
    &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
    <router-link to="/CustomDirectiveAndPlugins">
      自定义指令和插件
    </router-link>
    &nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
    <router-link to="/TestPlugins">外部插件</router-link>
  </div>

  <router-view v-slot="{ Component }">
    <keep-alive :include="include">
      <component :is="Component" />
    </keep-alive>
  </router-view>
</template>

<style lang="scss">
@import url("../../styles/reset.css");

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>

<script lang="ts">
export default {
  name: "App",
};
</script>

<script setup lang="ts">
import { RouterLink, RouterView } from "vue-router";
import { ref } from "vue";

const include = ref(["BySetup", "ByScriptSetup"]);
</script>
